package com.iflytek.jcy.supervise.clue.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.iflytek.jcy.supervise.clue.common.constants.AppConstants;
import com.iflytek.jcy.supervise.clue.entity.SysDictData;

import java.util.List;

/***
* @description  字典表 数据层
* @author  dgyu
* @date    2023/1/14 21:02
*/
public interface SysDictDataMapper extends BaseMapper<SysDictData> {

    default List<SysDictData> selectDictDataByType(String dictType) {
        return selectList(
            new LambdaQueryWrapper<SysDictData>()
                .eq(SysDictData::getStatus, AppConstants.DICT_NORMAL)
                .eq(SysDictData::getDictType, dictType)
                .orderByAsc(SysDictData::getDictSort));
    }
}
